Text recognition for textually sparse images

ABSTRACT

A text recognition server is configured to recognize text in a sparse text image. Specifically, given an image, the server specifies a plurality of “patches” (blocks of pixels within the image). The system applies a text detection algorithm to the patches to determine a number of the patches that contain text. This application of the text detection algorithm is used both to estimate the orientation of the image and to determine whether the image is textually sparse or textually dense. If the image is determined to be textually sparse, textual patches are identified and grouped into text regions, each of which is then separately processed by an OCR algorithm, and the recognized text for each region is combined into a result for the image as a whole.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.12/608,877 filed Oct. 29, 2009. The entire disclosure of the aboveapplication is incorporated herein by reference.

BACKGROUND

1. Field of Art

The present invention generally relates to the field of digital imaging,and more specifically, to methods of text recognition for use withimages having comparatively little text.

2. Background of the Invention

Recognizing text within a digital image is a useful capability madepossible by modern computer systems. Conventional optical characterrecognition (OCR) algorithms are designed for tasks such as recognizingtext within an image—hereinafter referred to as a textually “dense”image—that includes large blocks of regularly-spaced text. For example,textually dense images include digital scans or photographs of pages ofa book or magazine, where the text is arranged into columns, paragraphs,lines, and other regular and predictable units of text and occupies themajority, or at least a very sizeable portion, of the image.

However, there are a number of situations in which an image has littletext compared to the overall size of the image—i.e., the image istextually “sparse”—and the text is not arranged in predictable units,yet recognition of the small amount of text is still beneficial. Forexample, a person taking a digital photo of a restaurant on her mobilephone might wish to look up information about the restaurant using thename painted on the restaurant building. As another example, a persontaking a digital photo of a street scene using his mobile phone mightwish to be presented with the option of dialing a phone number appearingin a billboard within the photo.

Conventional OCR algorithms, which are designed for recognition of textin textually dense images, have several shortcomings when applied totextually sparse images. First, conventional OCR algorithms haverelatively poor performance when analyzing textually sparse images,since they perform the same text analysis across the entire image, eventhough only a small portion of it contains text. Second, conventionalOCR algorithms have less than desirable accuracy for textually sparseimages. For example, textures or other graphical patterns adjacent to aportion of text may cause the conventional OCR algorithm to fail torecognize that portion as text, instead incorrectly interpreting it tobe part of the texture. Conversely, an OCR algorithm will also sometimesincorrectly interpret a non-textual graphical pattern to constitute asmall portion of text, e.g. one or two characters. Thus, conventionalOCR algorithms tend both to fail to recognize genuine text, and toincorrectly “recognize” small amounts of spurious text.

SUMMARY

A text recognition server is configured to recognize text in a sparsetext image, i.e., an image having a relatively small amount of text.Specifically, given an image, the server specifies a plurality of“patches” (blocks of pixels within the image). In one embodiment, thepatches include sets of patches of various sizes and overlap with eachother. The system applies a text detection algorithm, such as aclassifier trained on images previously identified as containing text,to the patches to determine a number of the patches that contain text.This application of the text detection algorithm is used both toestimate the orientation of the image (i.e., whether the image isoriented “vertically,” as expected by an OCR algorithm, or whether it isrotated sideways from vertical position), and to determine whether theimage is textually sparse, or textually dense (i.e., not sparse).

If the image is determined to be textually sparse, textual patches areidentified and grouped into text regions, each of which is thenseparately processed by an OCR algorithm, and the recognized text foreach region is combined into a result for the image as a whole. Theseparate analysis of individual patches and text regions permitsparallelization, resulting in faster processing times. The recognizedtext may be provided to a client as-is, or it may be further used asinput to other systems to obtain additional results, such as searchresults for the recognized text provided by a search engine.

In one embodiment, a computer-implemented method of recognizing text inan image specifies a plurality of patches within the image. The methodidentifies, within the plurality of patches, a set of patches thatcontain text, and groups, within the set of patches, patches proximateto one another into a text region. The method further recognizes textwithin the text region, and outputs the recognized text.

The features and advantages described in the specification are not allinclusive and, in particular, many additional features and advantageswill be apparent to one of ordinary skill in the art in view of thedrawings, specification, and claims. Moreover, it should be noted thatthe language used in the specification has been principally selected forreadability and instructional purposes, and may not have been selectedto delineate or circumscribe the inventive subject matter.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of an image processing system in accordancewith one embodiment of the present invention.

FIG. 2 is a high-level block diagram illustrating physical components ofa computer of the image processing system, according to one embodiment

FIG. 3 is a block diagram illustrating a more detailed view of the textrecognition server of FIG. 1 according to one embodiment.

FIG. 4 conceptually depicts various possible patches on an image 400comprising text items, according to one embodiment.

FIGS. 5A and 5B illustrate images in an expected “vertical” orientationand in a rotated orientation, respectively.

FIG. 6 is a block diagram illustrating a more detailed view of thesparse text recognition module of FIG. 3 according to one embodiment.

FIG. 7 is a flowchart illustrating a high-level view of steps carriedout by the text recognition server of FIG. 1 for recognizing text in animage, according to one embodiment.

The figures depict embodiments of the present invention for purposes ofillustration only. One skilled in the art will readily recognize fromthe following description that alternative embodiments of the structuresand methods illustrated herein may be employed without departing fromthe principles of the invention described herein.

DETAILED DESCRIPTION System Architecture

FIG. 1 is a block diagram of an image processing system in accordancewith one embodiment of the present invention. An image processing system100 processes images, such as an image provided by a client device 120via a network 140. The image processing system 100 can perform a numberof different types of analysis on a provided image, such as textrecognition, face recognition, general object recognition, and the like.The text recognition features of the system 100 are set forth in detailbelow. The other possible types of image analysis, such as facerecognition, are not the focus of this application and are not discussedfurther herein.

The client device 120 is a computing device, such as a mobile phone,personal digital assistant, personal computer, laptop computer, or moregenerally any device connected to the network 140. The client device 120submits an image to the image processing system 100, e.g., via thenetwork 140.

The image processing system 100 comprises an interface module 105 and atext recognition server 110. The image processing system 100 mayadditionally comprise any number of other servers for various purposes,such as an face recognition server or a general object recognitionserver (not depicted).

The interface module 105 receives an image from the client device 120over the network 140, provides it to the text recognition server 110(and to any other servers, such as face recognition servers, whoseoutput is desired), receives the recognized text from the textrecognition server 110, and provides the text to the client device 120.The interface module 105 can also provide the client device 120 with theresults from any other servers that analyzed the provided image.

The text recognition server 110 processes a digital image and outputstext that was recognized within the image. In particular, the textrecognition server 110 employs a text recognition algorithm that isoptimized for use with textually sparse images. The processed images canbe the images received from a client device 120 by the interface module105, but may equally come from any other source, such as images storedon removable storage media such as a DVD or CD-ROM, images accessible tothe image processing system via the network 140, such as imagesavailable on public web sites, and the like. The operations of the textrecognition server 110 are described below in greater detail withrespect to FIG. 3.

The image processing system 100 need not be embodied in a singlecomputer but rather may be partitioned across multiple computers orlogical storage units in a number of different manners. For example, inone embodiment, the text recognition server 110 and the interface module105 constitute, or are located on, distinct physical computer systems.In such an embodiment, although the image processing system 100 isdepicted in FIG. 1 as comprising only one text recognition server 110and one interface module 105, there could be any number of each. Forexample, there could be multiple separate text recognition servers 110,each being a machine such as that depicted in FIG. 2 (discussed below),thus allowing for text recognition operations to take place in parallel.In another embodiment, the image processing system 100 is a singlephysical computer system as in FIG. 2, and the interface module 105 andtext recognition server 110 are implemented as processes executingthereon. In this embodiment, the text recognition server 110 can performtext recognition operations in parallel if the image processing systemcomprises sufficient hardware components, such as multiple processors ormulti-core processors.

The network 140 represents the communication pathways between the clientdevice 120 and the image processing server 100. In one embodiment, thenetwork 140 uses standard Internet communications technologies and/orprotocols. Thus, the network 140 can include links using technologiessuch as Ethernet, 802.11, integrated services digital network (ISDN),asynchronous transfer mode (ATM), etc. Similarly, the networkingprotocols used on the network 140 can include the transmission controlprotocol/Internet protocol (TCP/IP), the hypertext transport protocol(HTTP), the simple mail transfer protocol (SMTP), the file transferprotocol (FTP), etc. The data exchanged over the network 140 can berepresented using technologies and/or formats including the hypertextmarkup language (HTML), the extensible markup language (XML), etc. Inaddition, all or some links can be encrypted using conventionalencryption technologies such as the secure sockets layer (SSL), SecureHTTP (HTTPS) and/or virtual private networks (VPNs). In anotherembodiment, the entities can use custom and/or dedicated datacommunications technologies instead of, or in addition to, the onesdescribed above.

FIG. 2 is a high-level block diagram illustrating physical components ofa computer 200 used as part of the image processing system 100 from FIG.1, according to one embodiment. Illustrated are at least one processor202 coupled to a chipset 204. Also coupled to the chipset 204 are amemory 206, a storage device 208, a keyboard 210, a graphics adapter212, a pointing device 214, and a network adapter 216. A display 218 iscoupled to the graphics adapter 212. In one embodiment, thefunctionality of the chipset 204 is provided by a memory controller hub220 and an I/O controller hub 222. In another embodiment, the memory 206is coupled directly to the processor 202 instead of the chipset 204.

The storage device 208 is any computer-readable storage medium, such asa hard drive, compact disk read-only memory (CD-ROM), DVD, or asolid-state memory device. The memory 206 holds instructions and dataused by the processor 202. The pointing device 214 may be a mouse, trackball, or other type of pointing device, and is used in combination withthe keyboard 210 to input data into the computer 200. The graphicsadapter 212 displays images and other information on the display 218.The network adapter 216 couples the computer system 200 to a local orwide area network.

As is known in the art, a computer 200 can have different and/or othercomponents than those shown in FIG. 2. In addition, the computer 200 canlack certain illustrated components. In one embodiment, a computer 200acting as a server may lack a keyboard 210, pointing device 214,graphics adapter 212, and/or display 218. Moreover, the storage device208 can be local and/or remote from the computer 200 (such as embodiedwithin a storage area network (SAN)).

As is known in the art, the computer 200 is adapted to execute computerprogram modules for providing functionality described herein. As usedherein, the term “module” refers to computer program logic utilized toprovide the specified functionality. Thus, a module can be implementedin hardware, firmware, and/or software. In one embodiment, programmodules are stored on the storage device 208, loaded into the memory206, and executed by the processor 202.

Embodiments of the entities described herein can include other and/ordifferent modules than the ones described here. In addition, thefunctionality attributed to the modules can be performed by other ordifferent modules in other embodiments. Moreover, this descriptionoccasionally omits the term “module” for purposes of clarity andconvenience.

FIG. 3 is a block diagram illustrating a more detailed view of the textrecognition server 110 of FIG. 1 according to one embodiment. The textrecognition server 110 comprises a text orientation determination module330 for determining whether the text in the image is in the “vertical”orientation expected by an OCR algorithm or (for example) is rotatedsideways, a text density determination module 340 for determiningwhether the image is textually sparse or dense, a sparse textrecognition module 350 for recognizing text within a textually sparseimage, and several supporting modules 310-325, 360.

Generally speaking, the modules 330-350 perform analysis on individualregions of an image, hereinafter referred to as “patches.” Theboundaries of the various patches to analyze are specified to themodules 330-350 by a patch identification module 310. In one embodiment,the patches are rectangular in shape, although other shapes are alsopossible. In one embodiment, the patches are drawn from locations thattaken together cover the entire image, and have a variety of sizes. FIG.4 conceptually depicts various possible patches on an image 400comprising text items 402 and 404, a message to call a particular phonenumber, and the name of a restaurant, respectively. Although non-textualportions of the image of FIG. 4 are omitted to simplify the discussion,these text items might correspond, for example, to a sign for a coffeeshop located in the foreground of the picture, and text on anadvertisement located on a billboard in the background. FIG. 4illustrates the boundaries of a set of patches 412 that comprisespatches of comparatively small size. Sets of patches 414A and 414B bothcontain patches of approximately twice the edge length (and thus fourtimes the area) of those of set 412, and sets of patches 416 are in turnapproximately twice the length and four times the area of those of sets414. (It is appreciated that the depicted patches merely represent theboundaries of pixel regions that are analyzed by the text recognitionserver 110, and are not part of the image 400 itself).

Note that the individual characters of the comparatively large text item404 do not fit within the boundaries of the small patches of patch set412, nor do they fit comfortably within the larger patches of patch sets414. However, the larger patches of patch set 416 are large enough tocontain several characters of text item 404, and are thus better suitedfor recognition of text by the text detection module 320 than are thoseof smaller patch sets 412 and 414, although the latter are sizedappropriately for recognizing the smaller characters of text item 402.Thus, analyzing patches of various sizes allows for recognition of textthat might otherwise have been missed, such as the characters of textitem 404, which would likely not have been recognized had only thesmaller patches 412, 414 been employed. Similarly, employing overlappingpatch sets serves to recognize text that might otherwise have beenmissed. For example, the text “8322” of the phone number of text item402 is split vertically between patches of patch set 414B, thus makingit unlikely that application of the text detection module 320 to thosepatches would detect the text. However, the text “8322” falls squarelywithin the boundary of a patch of overlapping patch set 414A, and thuswould be detected as part of analysis of that patch set.

Thus, in one embodiment the patch identification module 310 of FIG. 3begins with patches of some minimum size, e.g. rectangular regions 32pixels in width and 16 pixels in height, iteratively moving across theimage until the entire image has been covered by some patch. In order toprovide overlap in the patches, the next successive patch provided canbe located at an offset from the prior patch that is less than the patchdimensions. For example, for a 32×16 pixel patch located at imagecoordinate (0, 0), the next 32×16 pixel patch could be located atcoordinate (16, 0), thus moving over by half the width of the patch, andwhen that “row” of the image has been completely covered by patches, thenext 32×16 patch could be located at coordinate (0, 8), thus moving downby half the height of the patch. Then, when the entire image has been“covered” by patches, the patch identification module 310 chooses a new,larger patch size and repeats the above process using the largerpatches. Thus, the patch identification module specifies sets of patchesat successively larger patch sizes, thereby allowing recognition of texttoo large to be identified within smaller patches. In one embodiment,larger sizes are chosen as fractions of powers of 2, e.g. 2^(0.25),2^(0.5), 2^(0.75), 2¹, 2^(1.25), and so forth, thereby producing patchesof dimensions 32×16, 38×19, 45×23, 54×27, 64×32, 76×38, and so forth. Inone embodiment, larger patches continue to be chosen in this manneruntil the patch exceeds the size of the image. In another embodiment,larger patches are chosen up to some predetermined maximum size, such asa fixed pixel dimension, or a fixed percentage of the size of the image.

It is appreciated that the sets of patches depicted in FIG. 4 are purelyfor the purpose of illustration. The patches need not have the exactshapes and sizes depicted, nor need there be only 3 distinct patchsizes. Further, though each patch set 412, 414, 416 is depicted ascovering only a portion of the image 400, they should be understood tocover the entire image.

Referring again to FIG. 3, a text detection module 320 operates onpatches specified by the patch identification module 310, returning anoutput indicating whether the patch to which it was applied containstext. In one embodiment, the text detection module 320 is implementedusing a classifier algorithm trained to recognize text, such as acascading classifiers algorithm, in which a number of different visualproperties are analyzed to determine whether the image appears tocontain text when analyzed according to each property. Theclassification algorithm is previously trained to recognize text byanalyzing a set of images, each marked as containing text or notcontaining text, in order to learn the visual qualities that indicatethe presence of text. In one embodiment, the text detection module 320ensures that each patch is of a uniform size (e.g. 32×16 pixels),scaling down the contents of a larger patch as necessary, beforeexecuting the classifier algorithm.

FIG. 3 further depicts a text quantification module 325, which appliesthe text detection module 320 to the patches specified by the patchidentification module 310 to output a value that quantifies the amountof text that is present within an image. In one embodiment, for example,the text quantification module 325 applies the text detection module 320to each patch of the set of overlapping patches at each of the varioussizes, keeping a count of the number of patches which the text detectionmodule 320 determines to contain text. In other embodiments thequantification output represents values other than number of patcheshaving recognized text, such as an approximation of a total number ofcharacters recognized. The processing of the various patches may bedistributed among some plurality of processors, with each of theprocessors performing analysis (e.g., applying the text detection module320) on some subset of the patches, thus allowing parallel processingand thereby reducing the overall processing time required.

Both the text orientation determination module 330 and the text densitydetermination module 340 of FIG. 3 use the results from the textquantification module 325 to perform their respective analyses—namely,to determine whether the image is vertical or rotated to some degree,and to determine whether the text is sparse or dense. Initially, it isnot known whether the text of the image is in a “vertical” orientation,as OCR algorithms expect, and as depicted in FIG. 5A, or whether (forexample) the image was photographed sideways causing the text to be inrotated form, as in FIG. 5B. Thus, the text orientation determinationmodule 330 produces, from the original received image, one or morerotated versions of the image. For the original image and for eachrotated version thereof, the text quantification module 325 quantifiesthe amount of text present in that image, and the text orientationdetermination module 330 compares the resulting values. In oneembodiment, the text orientation determination module 330 selects theimage with the greatest resulting value as the version to analyze in thesubsequent processing steps. In another embodiment, if none of theimages has a result value that is at least some threshold degree greaterthan that of the others—e.g., 100% greater—then none of the images isdefinitively determined to be the correctly-oriented image, and each issubsequently further analyzed as described below, rather than only oneof them.

As one example, in an embodiment in which the text orientationdetermination module 330 produces one rotated version rotated 90 degreesclockwise, the text orientation determination module 330 determines theoriginal version of the image to be the version having properly-orientedtext if the text quantification module 325 recognized more textualpatches within it than within the rotated version, and the rotatedversion to be the one with properly-oriented text, if not. For example,if the original version of the image were that of FIG. 5B, then therotated version would be that of FIG. 5A, and the text quantificationmodule 325 would return a greater result value for the rotated versionthan for the original version, since the text detection module 320 wouldbetter recognize text in the properly-oriented image of FIG. 5A.

Referring again to FIG. 3, the text density determination module 340determines, based on the output value produced by the textquantification module 325 for the image (e.g., the number of patches inwhich text is detected), whether that image represents dense or sparsetext. In one embodiment, the produced value is compared to a threshold,such as 2,000 patches with detected text, to determine whether the imageis textually sparse or dense. In one embodiment, the text densitydetermination module 340 only performs this comparison for the versionof the image determined by the text orientation determination module 330to be the version containing correctly-oriented text.

The sparse text recognition module 350 recognizes text within an image,where the text density determination module 340 has deemed the image tobe textually sparse. The sparse recognition module 350 employs an OCRmodule 360 to recognize text within individual identified regions of theimage. Thus, the OCR module 360 accepts as input the image and adescription (e.g., a bounding rectangle) of a region of the image, andapplies the OCR algorithm to that region of the image, producing asoutput any text found within that region.

FIG. 6 is a block diagram illustrating a more detailed view of thesparse text recognition module 350 of FIG. 3 according to oneembodiment. Like the text detection module 320 used by the textquantification module 325, a text identification module 610 firstdetermines whether or not a given patch contains text, but does so usingan algorithm optimized for accuracy, rather the algorithm of the textdetection module that is optimized for speed. As described above,processing of the patches may be distributed among a plurality ofprocessors and the determinations made in parallel. In one embodiment,the text identification module 610 uses the algorithm of the textdetection module 320 to determine whether or not a given patch containstext, but it employs a higher-accuracy setting of that algorithm. Forexample, where the text detection module 320 uses cascading classifiers,and the text quantification module 325 instructs the text detectionmodule to consider two of the possible classifiers, the textidentification module 610 could instruct the text quantification module325 to consider fourteen factors, resulting in slower but more accuratetext recognition. In another embodiment, the text identification module610 employs a different algorithm different from that of the textdetection module 320. In any case, the result of the operation of thetext identification module 610 is an identified set of patches found tocontain text.

A patch grouping module 620 groups the patches identified as containingtext by the text identification module 610 into contiguous regions oftext. For example, in one embodiment a patch that has been identified ascontaining text is grouped with each other adjacent patch (i.e., a patchon the same grid of patches that is above, below, to the left, or to theright, of the patch in question) also identified as containing text,forming one text region. In another embodiment, overlapping patchesidentified as containing text are grouped into a single text region byforming the union of the overlapping areas using hierarchicalagglomerative clustering, in which patches are iteratively grouped intoa region as long as there remain ungrouped patches with a sufficientlylarge overlap with the region.

The sparse text recognition module 350 applies the OCR module 360 ofFIG. 3 to each region identified by the patch grouping module 620,producing a set of textual outputs, one for each region. The resultcombination module 630 then combines the individual textual outputsderived by the OCR module 360 for each of the text patch groupings intoan aggregated textual result associated with the entire image. In oneembodiment, this is accomplished by concatenating the individual textualresults in an order corresponding to a language or text system withwhich the image is associated. For example, where an image is consideredto contain text in the English language (e.g., because the image wassubmitted to the image processing system 100 via a server located in theUnited States), the individual textual results are combined in theleft-to-right, top-to-bottom order in which English text isconventionally arranged.

Process of Text Recognition

FIG. 7 is a flowchart illustrating a high-level view of steps carriedout by the text recognition server 110 for recognizing text in an image,according to one embodiment.

At step 710, the text recognition server 110 receives an image forprocessing. The particular source of the image could vary. For example,the image could be received directly from a client device 120 via thenetwork 140 and the interface module 105, or it could be read from localstorage on the image processing system 100.

At step 720, the text recognition server 110 quantifies the amount oftext present in both the image and in each rotated version of the image(if any). As described above with respect to the text orientationdetermination module 330, in one embodiment the quantification comprisescounting the number of patches found by a text identification algorithm,such as that of text detection module 320, to contain text.

At step 730, the text recognition server 110 determines textorientation. In one embodiment, the text orientation server 110 comparesthe quantification output values produced at step 720, and the versionof the image with the greatest value is the version processed insubsequent steps. In another embodiment, multiple versions can beprocessed in subsequent steps, e.g., in cases where none of the versionsof the image has an associated quantification output that issufficiently greater than that of the others.

At step 740, the text recognition server 110 determines whether theimage to be analyzed (such as either the original image or the rotatedimage) is textually sparse or dense. In one embodiment, thisdetermination comprises comparing the quantification result associatedwith the analyzed image, such as the number of image patches found tocontain text to some threshold (e.g., 2,000 patches), with numbersgreater than or equal to the threshold indicating dense text, andnumbers less than the threshold indicating sparse text.

If the image represents dense text, then the text recognition server 110applies 755 an OCR algorithm to the entire image as a whole, therebyproducing recognized text. If the image represents sparse text, however,then the text recognition server 110 proceeds to recognize 750 thesparse text as described above with respect to the sparse textrecognition module 350. Specifically, the recognition of the text withina sparse image comprises identifying 750A textual patches (e.g., using ahigher-quality algorithm than that used in step 720 to quantify theamount of text), grouping 750B textual patches proximate to one another(e.g., adjacent, or overlapping) into a single text region, therebyproducing a set of distinct text regions, and recognizing 750C text ineach of the text regions, such as by application of an OCR algorithm toeach of the regions. The recognized text from the set of distinct textregions is then combined 750D in some manner, such as by concatenatingthe text in an order corresponding to a language with which the image isassociated, to produce a final sparse text result for the image.

The application by the sparse text recognition module 350 of the OCRalgorithm to each text region, rather than to the image as a whole,reduces processing overhead by avoiding OCR analysis of regions notconsidered to contain text, and also improves accuracy by avoidinganalysis of regions evidently lacking text but possibly containingvisual elements (e.g., textures) that an OCR algorithm mightmis-recognize as random characters of text. It additionally enables areduction in overall processing time by allowing parallelization, inthat each identified region of grouped text patches can be distributedto a separate processing unit for analysis by the OCR algorithm.

In an embodiment in which an inconclusive result from the textorientation determination step 730 causes steps 750A-D to be applied toboth the original and rotated versions of the image, the results of eachare then further tested to determine which result is better. Forexample, in one embodiment the words of each are compared against somedictionary to determine which result contains more, or a greaterpercentage of, valid words, and that result is selected as the output ofstep 750.

Finally, the text recognition module 110 provides 760 the recognizedtext—whether produced from a sparse or dense image—to some destination.In one embodiment, the destination is a client device 120 that submittedthe analyzed image to the image processing system 110. In anotherembodiment, the destination is another component of the image processingsystem 100, such as the interface module 105, which can assemble therecognized text along with the results of any other servers of the imageprocessing system into a single result for transmission to the clientdevice 120 or provide the recognized text as input to some other serveror module. For example, the recognized text could be provided as anadditional input to a facial recognition module, or it could be providedto a search engine, which would produce search results and provide themto the client device 120.

The present invention has been described in particular detail withrespect to one possible embodiment. Those of skill in the art willappreciate that the invention may be practiced in other embodiments.First, the particular naming of the components and variables,capitalization of terms, the attributes, data structures, or any otherprogramming or structural aspect is not mandatory or significant, andthe mechanisms that implement the invention or its features may havedifferent names, formats, or protocols. Also, the particular division offunctionality between the various system components described herein ismerely for the purpose of example, and not mandatory; functionsperformed by a single system component may instead be performed bymultiple components, and functions performed by multiple components mayinstead performed by a single component.

Some portions of above description present the features of the presentinvention in terms of algorithms and symbolic representations ofoperations on information. These algorithmic descriptions andrepresentations are the means used by those skilled in the dataprocessing arts to most effectively convey the substance of their workto others skilled in the art. These operations, while describedfunctionally or logically, are understood to be implemented by computerprograms. Furthermore, it has also proven convenient at times, to referto these arrangements of operations as modules or by functional names,without loss of generality.

Unless specifically stated otherwise as apparent from the abovediscussion, it is appreciated that throughout the description,discussions utilizing terms such as “determining” or “displaying” or thelike, refer to the action and processes of a computer system, or similarelectronic computing device, that manipulates and transforms datarepresented as physical (electronic) quantities within the computersystem memories or registers or other such information storage,transmission or display devices.

Certain aspects of the present invention include process steps andinstructions described herein in the form of an algorithm. It should benoted that the process steps and instructions of the present inventioncould be embodied in software, firmware or hardware, and when embodiedin software, could be downloaded to reside on and be operated fromdifferent platforms used by real time network operating systems.

The present invention also relates to an apparatus for performing theoperations herein. This apparatus may be specially constructed for therequired purposes, or it may comprise a general-purpose computerselectively activated or reconfigured by a computer program stored on acomputer readable medium that can be accessed by the computer. Such acomputer program may be stored in a computer readable storage medium,such as, but is not limited to, any type of disk including floppy disks,optical disks, CD-ROMs, magnetic-optical disks, read-only memories(ROMs), random access memories (RAMs), EPROMs, EEPROMs, magnetic oroptical cards, application specific integrated circuits (ASICs), or anytype of computer-readable storage medium suitable for storing electronicinstructions, and each coupled to a computer system bus. Furthermore,the computers referred to in the specification may include a singleprocessor or may be architectures employing multiple processor designsfor increased computing capability.

The algorithms and operations presented herein are not inherentlyrelated to any particular computer or other apparatus. Variousgeneral-purpose systems may also be used with programs in accordancewith the teachings herein, or it may prove convenient to construct morespecialized apparatus to perform the required method steps. The requiredstructure for a variety of these systems will be apparent to those ofskill in the art, along with equivalent variations. In addition, thepresent invention is not described with reference to any particularprogramming language. It is appreciated that a variety of programminglanguages may be used to implement the teachings of the presentinvention as described herein, and any references to specific languagesare provided for invention of enablement and best mode of the presentinvention.

The present invention is well suited to a wide variety of computernetwork systems over numerous topologies. Within this field, theconfiguration and management of large networks comprise storage devicesand computers that are communicatively coupled to dissimilar computersand storage devices over a network, such as the Internet.

Finally, it should be noted that the language used in the specificationhas been principally selected for readability and instructionalpurposes, and may not have been selected to delineate or circumscribethe inventive subject matter. Accordingly, the disclosure of the presentinvention is intended to be illustrative, but not limiting, of the scopeof the invention, which is set forth in the following claims.

1. (canceled)
 2. A computer-implemented method of recognizing text in animage, comprising: receiving the image from a client device; identifyinga first plurality of patches within the image; applying, to each patchof the first plurality of patches, a first text detection algorithm thatindicates whether a patch contains text, thereby identifying a first setof patches that contain text; determining that the image representssparse text based at least in part on the identified first set ofpatches; and responsive to the image representing sparse text:identifying within the image, using a second text detection algorithm, asecond set of patches that contain text, performing optical characterrecognition on the second set of patches that contain text to obtain atextual result, and providing the textual result to the client device.3. The computer-implemented method of claim 2, wherein determining thatthe image represents sparse text comprises: determining a number ofpatches within the identified first set of patches that contain text;and comparing the number of patches that contain text to a threshold,wherein the image is deemed to represent sparse text when the number ofpatches is below the threshold.
 4. The computer-implemented method ofclaim 2, wherein determining that the image represents sparse textcomprises: determining an approximate number of characters in the image;comparing the approximate number of characters to a threshold, whereinthe properly-oriented image is deemed to represent sparse text when thenumber of characters is below the threshold.
 5. The computer-implementedmethod of claim 2, further comprising: grouping patches of the secondset of patches that contain text and are proximate to one another into atext region, wherein performing optical character recognition on thesecond set of patches that contain text to obtain the textual resultcomprises performing optical character recognition on the text region.6. The computer-implemented method of claim 5, wherein grouping patchesof the second set of patches that are proximate to one another into thetext region comprises combining overlapping patches and forming the textregion from a union of areas of the combined patches.
 7. Thecomputer-implemented method of claim 2, wherein the second set ofpatches comprises patches that overlap with each other or patches ofdifferent sizes.
 8. The computer-implemented method of claim 2, furthercomprising: receiving a second image; determining that the second imagerepresents dense text; and in response to determining that the secondimage represents dense text: performing optical character recognition onthe second image as a whole to produce a second textual result, andproviding the second textual result to the client device.
 9. A computersystem for recognizing text in an image, comprising: at least onecomputer processor; and a computer program executable by the computerprocessor and performing actions comprising: receiving the image from aclient device, identifying a first plurality of patches within theimage, applying, to each patch of the first plurality of patches, afirst text detection algorithm that indicates whether a patch containstext, thereby identifying a first set of patches that contain text,determining that the image represents sparse text based at least in parton the identified first set of patches, and responsive to the imagerepresenting sparse text: identifying within the image, using a secondtext detection algorithm, a second set of patches that contain text,performing optical character recognition on the second set of patchesthat contain text to obtain a textual result, and providing the textualresult to the client device.
 10. The computer system of claim 9, whereindetermining that the image represents sparse text comprises: determininga number of patches within the identified first set of patches thatcontain text; and comparing the number of patches that contain text to athreshold, wherein the image is deemed to represent sparse text when thenumber of patches is below the threshold.
 11. The computer system ofclaim 2, wherein determining that the image represents sparse textcomprises: determining an approximate number of characters in the image;comparing the approximate number of characters to a threshold, whereinthe properly-oriented image is deemed to represent sparse text when thenumber of characters is below the threshold.
 12. The computer system ofclaim 9, wherein the actions further comprise: grouping patches of thesecond set of patches that contain text and are proximate to one anotherinto a text region, wherein performing optical character recognition onthe second set of patches that contain text to obtain the textual resultcomprises performing optical character recognition on the text region.13. The computer system of claim 12, wherein grouping patches of thesecond set of patches that are proximate to one another into the textregion comprises combining overlapping patches and forming the textregion from a union of areas of the combined patches.
 14. The computersystem of claim 2, wherein the second set of patches comprises patchesthat overlap with each other or patches of different sizes.
 15. Thecomputer system of claim 2, wherein the actions further comprise:receiving a second image; determining that the second image representsdense text; and in response to determining that the second imagerepresents dense text: performing optical character recognition on thesecond image as a whole to produce a second textual result, andproviding the second textual result to the client device.
 16. Acomputer-implemented method of recognizing text in an image, comprising:receiving the image from a client device; identifying a first pluralityof patches within the image; applying, to each patch of the firstplurality of patches, a first text detection algorithm that indicateswhether a patch contains text, thereby identifying a first set ofpatches that contain text; determining whether the image representssparse text or dense text based at least in part on a number of patcheswithin the identified first set of patches; when the image representssparse text: identifying within the image, using a second text detectionalgorithm, a second set of patches that contain text, and performingoptical character recognition on the second set of patches that containtext to obtain a textual result, and when the image represents densetext: performing optical character recognition on the image as a wholeto obtain the textual result; and providing the textual result to theclient device.
 17. The computer-implemented method of claim 16, whereindetermining whether the image represents sparse text or dense textcomprises: determining a number of patches within the identified firstset of patches that contain text; and comparing the number of patchesthat contain text to a threshold, wherein the image is deemed torepresent sparse text when the number of patches is below the thresholdand is deemed to represent dense text when the number of patches isabove the threshold.
 18. The computer-implemented method of claim 16,wherein determining whether the image represents sparse text or densetext comprises: determining an approximate number of characters in theimage; and comparing the approximate number of characters to athreshold, wherein the image is deemed to represent sparse text when theapproximate number of characters is below the threshold and is deemed torepresent dense text when the approximate number of characters is abovethe threshold.
 19. The computer-implemented method of claim 16, whereinperforming optical character recognition on the second set of patchesthat contain text to obtain a textual result comprises: grouping patchesof the second set of patches that contain text and are proximate to oneanother into a text region; and performing optical character recognitionon the text region
 20. The computer-implemented method of claim 19,wherein grouping patches of the second set of patches that are proximateto one another into the text region comprises combining overlappingpatches and forming the text region from a union of areas of thecombined patches.
 21. The computer-implemented method of claim 16,wherein the second set of patches comprises patches that overlap witheach other or patches of different sizes.